package team.fivez.defaultmanage.dao.Impl;

import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import team.fivez.defaultmanage.dao.RedoReasonDao;
import team.fivez.defaultmanage.domain.RedoReason;

import javax.annotation.Resource;

@Repository
public class RedoReasonDaoImpl implements RedoReasonDao {

    @Resource
    private JdbcTemplate jdbcTemplate;

    //通过数字序号查找重生原因
    @Override
    public RedoReason getRedoReasonByNumber(int number) {
        String sql="select * from redo_reason where redo_number=?";
        return jdbcTemplate.queryForObject(sql,new BeanPropertyRowMapper<>(RedoReason.class),number);
    }
}
